home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / gnu / bash / bash_110 / unixmode / src_d3.zoo / boot-strap.sh next >
Encoding:
Text File  |  1991-11-06  |  2.4 KB  |  89 lines

  1. if [ ! $1 ]
  2. then
  3.    echo "usage : \". boot-strap filename\""
  4.    return 1
  5. fi
  6. if [ ! -e $1 ]
  7. then
  8.     echo "File $1 does not exist, aborting...."
  9. else 
  10.   if [ ! -e patches.zoo ]
  11.   then
  12.       echo "patches.zoo must be in this directory, aborting...."
  13.   else 
  14.     clear 
  15.  
  16. # Get the main source from the virgin distribution.
  17.     echo "Extracting \"*.[cyh]\" and \"*.def\" from $1"
  18.     tar xf $1 bash-1.10/*.[chy] bash-1.10/*.def
  19.     cd bash-1.10
  20.     mv ../patches.zoo .
  21.  
  22. # Scramble the directory structure into something almost logical.
  23.     echo "Reorganizing directory structure"
  24.     mkdir src                    # where source will reside
  25.     mv *.[cyh] src/                # put virgin source in src/
  26.     mv builtins/ src/                # atomic move builtins sub-dir
  27. # Extract our mods/patches from the patches zoo archive.
  28.     echo "Extracting files from \"patches.zoo\""
  29.     zoo x.// patches.zoo
  30.     rm -r -f lib/readline/examples        # get ride of some baggage
  31.     rm -r -f lib/readline/doc
  32.     rm -r -f documentation
  33.     rm -r -f support
  34.     rm src/builtins/psize.c
  35.  
  36. # Apply Patches, check for errors.
  37.     echo "Applying patches"
  38.  
  39.     cd lib/readline                # We do readline first
  40.     patch <../../read.diff             # patch it
  41.     if [ -e *.rej ]; then
  42.       for i in *.rej
  43.         do 
  44.           echo "Failed to patch $i correctly."    # report all errors
  45.         done
  46.       return 1                    # and punt out of it
  47.     fi
  48.     rm *.orig                 # We made it, get rid of originals
  49.     rm ../../read.diff            # and patch file    
  50.     cd ../../
  51.     
  52.     cd src/builtins                # We do src/builtins next
  53.     patch <../../built.diff             # patch it
  54.     if [ -e *.rej ]; then
  55.       for i in *.rej
  56.         do 
  57.           echo "Failed to patch $i correctly."    # report all errors
  58.         done
  59.       return 1                    # and punt out of it
  60.     fi
  61.     rm *.orig                 # We made it, get rid of originals
  62.     rm ../../built.diff            # and patch file
  63.     cd ../../      
  64.  
  65.     cd src                    # We do src last
  66.     patch <../source.diff             # patch it
  67.     if [ -e *.rej ]; then
  68.       for i in *.rej
  69.         do 
  70.           echo "Failed to patch $i correctly."    # report all errors
  71.         done
  72.       return 1                    # and punt out of it
  73.     fi
  74.     rm *.orig                 # We made it, get rid of originals
  75.     rm ../source.diff            # and patch file
  76.     cd ../../
  77.  
  78. # move it all up a directory, 
  79.     mv bash-1.10/* .
  80. # Then get rid of the empty,
  81.     rm -r -f bash-1.10        
  82.  
  83. # Wow it all seemed to work
  84.     echo "
  85.            Bash patch successful. You may now build a BASH!
  86.          "
  87.   fi
  88. fi
  89.